module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    
    qunit: {
	options: {
      		timeout: 10000,
      		'--cookies-file': 'misc/cookies.txt',
		'force':'true'
    		},
        all: ['test/*.html']
    },
    connect: {
        server: {
            options: {
              port: 8800,
              base: '.'
            }
        }
    },
    
    concat: {
        options: {
          // define a string to put between each file in the concatenated output
          separator: ';'
        },
        dist: {
          // the files to concatenate
          src: ['src/*.js'],
          // the location of the resulting JS file
          dest: 'dist/<%= pkg.name %>.js'
        }
      },

    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      dist: {
        files: {
          'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
        }
      }
    }
  });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-concat');

  // Default task(s).
  grunt.registerTask('default', ['concat','uglify','connect','qunit']);

};